<div class="examplan">
  <div class="wrap">
    <app-menutab [pageStyle]="{'padding':'0 2px 10px 2px','height':'50px'}" [pageName]="'examconstructionplan_sg'">
    </app-menutab>
    <div class="fl p10">
      <span class="fl mr10" *ngIf="approval">
        <button nz-button nzType="primary" (click)="ratifyReject('ratify')"><i nz-icon
            nzType="check-circle"></i>批准</button>
        <button nz-button nzType="primary" (click)="ratifyReject('reject')"><i nz-icon
            nzType="close-circle"></i>驳回</button>
      </span>
      <span class="fl mr10" *ngIf="shopsign">
        <button nz-button nzType="primary" (click)="shopsignPop()"><i nz-icon nzType="check-circle"></i>签收</button>
      </span>
      <span class="fl mr10" *ngIf="shopbatches">
        <button nz-button nzType="primary" (click)="adjustWork('shop')"><i nz-icon
            nzType="usergroup-add"></i>调到车间</button>
        <button nz-button nzType="primary" (click)="adjustWork('work')"><i nz-icon
            nzType="usergroup-add"></i>调到工区</button>
        <button *ngIf="userInfo.N_LEVEL==30" nz-button nzType="primary" (click)="showModifyGq()"><i nz-icon
            nzType="link"></i>匹配工区</button>
        <button nz-button nzType="primary" (click)="adjustWork('batches')"><i nz-icon
            nzType="column-width"></i>确认分批</button>
      </span>
      <span class="fl mr10" *ngIf="planEdit">
        <button nz-button nzType="primary" (click)="drwxPop()"><i nz-icon nzType="down-square"></i>导入日计划</button>
        <button nz-button nzType="primary" (click)="ppczPop()"><i nz-icon nzType="link"></i>匹配车站</button>
        <button nz-button nzType="primary" (click)="ldspPop()"><i nz-icon nzType="check-circle"></i>提报审批</button>
      </span>
      <span class="fl mr10">
        <!-- &nbsp;计划日期&nbsp;
                <nz-range-picker style="width:220px" nzFormat="yyyy-MM-dd" [(ngModel)]="zyrqValue">
                </nz-range-picker> -->
        &nbsp;起&nbsp;
        <nz-date-picker style="width:120px;" nzFormat="yyyy-MM-dd" [(ngModel)]="zyrqStartValue">
        </nz-date-picker>
        &nbsp;止&nbsp;
        <nz-date-picker style="width:120px;" nzFormat="yyyy-MM-dd" [(ngModel)]="zyrqEndValue">
        </nz-date-picker>

        <span class="fl line32" *ngIf="planView">&nbsp;状态&nbsp;</span>
        <nz-select *ngIf="planView" class="fl planselect" nzAllowClear (ngModelChange)="listOfTagChange($event)"
          nzMode="multiple" [(ngModel)]="listOfTagOptions">
          <nz-option *ngFor="let option of listOfOption" [nzLabel]="option.label" [nzValue]="option.value">
          </nz-option>
        </nz-select>
        &nbsp;
        <button nz-button nzType="primary" (click)="readyload(rowPage, pageValue)">查询</button>
      </span>
      <span class="fl mr10">
        <button nz-button nzType="primary" nzPlacement="bottom" nz-popconfirm nzCancelText="取消" nzOkText="确定"
          nzTitle="删除计划将同步删除派工单，确定要删除吗？" [disabled]="selectedDataLen==0" (nzOnConfirm)="delItems()"><i nz-icon
            nzType="delete" nzTheme="outline"></i>
          <span>删除</span>
        </button>
      </span>
    </div>
    <div class="clear"></div>
    <nz-table #examTable [nzScroll]="lockHeadScroll" nzSize="small" [nzLoadingDelay]="1000" [nzShowPagination]="false"
      [nzFrontPagination]="false" [nzPageSize]="pageValue" [nzData]="examData" nzBordered
      (nzCurrentPageDataChange)="currentPageDataChange($event)" (nzPageIndexChange)="refreshStatus()"
      (nzPageSizeChange)="refreshStatus()">
      <thead>
        <tr>
          <th nzAlign="center" nzWidth="50px" nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate"
            (nzCheckedChange)="checkAll($event)"></th>
          <th nzAlign="center" nzWidth="50px">颜色</th>
          <th nzAlign="center" nzWidth="4%">状态</th>
          <th nzAlign="center" nzWidth="3%">责任部门</th>
          <th nzAlign="center" nzWidth="4%">计划日期</th>
          <th nzAlign="center" nzWidth="3%">计划号</th>
          <th nzAlign="center" nzWidth="4%">施工类型</th>
          <th nzAlign="center" nzWidth="4%">登记站</th>
          <th nzAlign="center" nzWidth="4%">匹配系统站</th>
          <th nzAlign="center" nzWidth="4%">工区</th>
          <th nzAlign="center" nzWidth="3%">线别</th>
          <th nzAlign="center" nzWidth="5%">站/区段</th>
          <th nzAlign="center" nzWidth="3%">时间</th>
          <th nzAlign="center" nzWidth="3%">行别</th>
          <th nzAlign="center" nzWidth="3%">等级</th>
          <th nzAlign="center" nzWidth="7%">项目</th>
          <th nzAlign="center" nzWidth="4%">维修类型</th>
          <th nzAlign="center" nzWidth="3%">天窗类型</th>
          <th nzAlign="center" nzWidth="4%">施工里程</th>
          <th nzAlign="center" nzWidth="8%">施工内容</th>
          <th nzAlign="center" nzWidth="4%">配合单位</th>
          <th nzAlign="center" nzWidth="4%">作业单位</th>
          <th nzAlign="center" nzWidth="3%">负责人</th>
          <th nzAlign="center" nzWidth="3%">审批人</th>
          <th nzAlign="center" nzWidth="7%">审批意见</th>
          <th nzAlign="center">备注</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let item of examTable.data;" class="doHover">
          <td nzShowCheckbox [(nzChecked)]="item.checked" [nzDisabled]="item.disabled"
            (nzCheckedChange)="refreshStatus()"></td>
          <td nzAlign="center">
            <span [class]="statusFollow(item.VC_STATUS)"></span>
          </td>
          <td nzAlign="center">{{item.RWXSTATUS}}</td>
          <td nzAlign="center">{{item.VC_CJORGQ == 0 ? '车间' : '工区'}} </td>
          <td nzAlign="center">{{item.DT_WORK$DAY | date:'yyyy-MM-dd'}}</td>
          <td nzAlign="center">{{item.N_ID}}</td>
          <td>{{item.ISPH}}</td>
          <td nzAlign="center">{{item.VC_DO$SECTION}}</td>
          <td nzAlign="center">{{item.STANAME}}</td>
          <td nzAlign="center">{{item.ORGNAME}}</td>
          <td nzAlign="center">{{item.VC_SG$ROUTE}}</td>
          <td nzAlign="center">{{item.VC_WORK$PLACE}}</td>
          <td nzAlign="center">{{item.VC_SKYWIN$STIME}}-{{item.VC_SKYWIN$ETIME}}</td>
          <td>{{item.VC_SG$DIRECTORYNAME}}</td>
          <td nzAlign="center">{{item.VC_LEVEL}}</td>
          <td>{{item.VC_TYPE}}</td>
          <td nzAlign="center">{{item.VC_SGDATATYPE}}</td>
          <td nzAlign="center">{{item.SKYWINNAME}}</td>
          <td>
            <div class="cmiddle" style="max-height:105px;">{{item.VC_SG$LENGTH}}</div>
          </td>
          <td>
            <div class="cmiddle" style="max-height:105px;">{{item.VC_PROJECT}}</div>
          </td>
          <td nzAlign="center">{{item.VC_SG$WOKEHELP}}</td>
          <td nzAlign="center">{{item.VC_SG$DOUNIT}}</td>
          <td nzAlign="center">{{item.VC_WA$PERSON}}</td>
          <td nzAlign="center">{{item.VC_SP$PERSON}}</td>
          <td>
            <div class="cmiddle" style="max-height:105px;">{{item.VC_SP$NOTE}}</div>
          </td>
          <td>
            <div class="cmiddle" style="max-height:105px;">{{item.VC_ORDER}}</div>
          </td>
        </tr>
      </tbody>
    </nz-table>

    <div class="pageWrap">
      每页
      <nz-select [(ngModel)]="selectedValue" (ngModelChange)="yearselectedChange()">
        <nz-option nzValue="10" nzLabel="10"></nz-option>
        <nz-option nzValue="50" nzLabel="50"></nz-option>
        <nz-option nzValue="100" nzLabel="100"></nz-option>
        <nz-option nzValue="200" nzLabel="200"></nz-option>
      </nz-select>
      条&nbsp;&nbsp;&nbsp;总共<span class="pageTotal">{{pageTotal}}</span>条
    </div>
    <div class="pageInation">
      <nz-pagination [nzPageSize]="selectedValue" [nzPageIndex]="pageIndex" [nzTotal]="rowTotal"
        (nzPageIndexChange)="rowChangeTable1($event)"></nz-pagination>
    </div>
  </div>

  <nz-modal [(nzVisible)]="drwxVisible" nzTitle="导入施工日计划" (nzOnCancel)="drwxCancel()" (nzOnOk)="drwxOk()">
    选择导入日期：
    <nz-date-picker [(ngModel)]="drrqValue"></nz-date-picker>
  </nz-modal>
  <nz-modal [(nzVisible)]="ppczVisible" nzWidth="800" nzTitle="匹配系统车站" (nzOnCancel)="ppczCancel()" (nzOnOk)="ppczOk()">
    <div class="pb15">你已选择计划号：<span class="red">{{ppczIds}}</span></div>
    <app-farmreact #farmReact></app-farmreact>
  </nz-modal>
  <nz-modal [(nzVisible)]="ldspVisible" nzTitle="提交审批" (nzOnCancel)="ldspCancel()" (nzOnOk)="ldspOk()">
    审批人：
    <nz-select [(ngModel)]="ldspValue">
      <nz-option *ngFor="let data of ldspSelect" [nzValue]="data.opValue" [nzLabel]="data.opName"></nz-option>
    </nz-select>
  </nz-modal>
  <nz-modal [(nzVisible)]="ratifyRejectVisible" [nzTitle]="ratifyRejectTitle" (nzOnCancel)="ratifyRejectCancel()"
    (nzOnOk)="ratifyRejectOk()">
    你已选择计划号：<span class="red">{{ppczIds}}</span>，确认{{ratifyRejectText}} ？
    <div class="mt15" *ngIf="approval">审批意见：<input style="width:300px" nz-input [(ngModel)]="ShenpiMessage"></div>
  </nz-modal>
  <nz-modal [(nzVisible)]="modifyGqModal" nzTitle="修改匹配工区" (nzOnCancel)="hideModifyGq()" (nzOnOk)="modifyGq()">
    工区：
    <nz-select nzAllowClear [(ngModel)]="ppWorkareaid" (ngModelChange)="workareaChange($event)" style="width: 160px;"
      [nzDropdownStyle]="{height:'300px',width:'200px'}">
      <nz-option *ngFor="let option of workarea" [nzLabel]="option.opName" [nzValue]="option.opValue">
      </nz-option>
    </nz-select>
    匹配系统站
    <!-- <nz-select nzAllowClear [(ngModel)]="ppStation" style="width: 160px;">
      <nz-option *ngFor="let option of stationSelect" [nzLabel]="option.opName" [nzValue]="option.opValue">
      </nz-option>
    </nz-select> -->
    <nz-tree-select style="width: 160px;" [nzNodes]="stationSelect" [(ngModel)]="ppStation"
      [nzDropdownStyle]="{height:'300px',width:'200px'}">
    </nz-tree-select>

  </nz-modal>
</div>
